using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using AutoMapper;
using DealerPlatform.Domain;
using DealerPlatform.Service.ProductApp.Dto;
using DealerPlatform.Service.ShoppingCartApp.Dto;

namespace DealerPlatform.Service
{
    public class DealerPlatformProfile : Profile
    {
        public DealerPlatformProfile()
        {
            CreateMap<Product, ProductDto>().ReverseMap();  //ReverseMap，正反都能转换
            CreateMap<ProductPhoto, ProductDto>().ForMember(dest => dest.Id, opt => opt.Ignore()).ReverseMap();     //忽略某字段不转换
            CreateMap<ProductSale, ProductDto>().ReverseMap();
            CreateMap<ProductSaleAreaDiff, ProductDto>().ReverseMap();

            CreateMap<ShoppingCart, ShoppingCartDto>().ReverseMap();
            CreateMap<ShoppingCart, ShoppingCartInputDto>().ReverseMap();
        }
    }
}